<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/index.css" rel="stylesheet">
    <link href="css/base.css" rel="stylesheet">
    <script type="text/javascript" src="js/angular/jquery.min.js"></script>
    <script type="text/javascript" src="js/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/angular/angular.min.js"></script>
    <script type="text/javascript" src="js/angular/angular-ui-router.min.js"></script>
    <script type="text/javascript" src="js/angular/angular-animate.js"></script>
    <script type="text/javascript" src="js/index.js" language="javascript"></script>
    <script src="js/cookies/angular-cookies.js"></script>
    <script src="js/cookies/jquery.cookie.min.js"></script>
    <style>
        body{ background-color:#f7f7f7;}
        .login{ width:350px; height:500px; margin: 0 auto; background-color:#f7f7f7; border: 1px solid #dddddd;}
        .login_head{ width: 100%; text-align: center;background-color: #2D528D;}
        .login_head img{ margin-top: 10px; margin-bottom: 10px;}
        .login h3{ width: 100%; text-align: center; font-size:16px;}
        .form-group{ width:80%; margin: 0 auto; margin-bottom:15px;}
        .btn-block,.clearfix{ width: 80%; margin: 0 auto;}
    </style>
</head>
<body ng-app="login">
        <div class="login" ng-controller="loginadmin">
            <div class="login_head"><img src="images/newHDS.jpg"></div>
            <h3>用户登录</h3>
            <form>
                <div class="form-group">
                    <select id="siteSelect"  class="form-control">
                        <option  value="{{data.region}}" ng-repeat="data in data" >{{data.region}}</option>
                    </select>
                </div>
                <div class="form-group">
                    <label class="control-label">输入用户名</label>
                    <input type="text" placeholder="请输入用户名" required="" ng-model="use.name" class="form-control">
                </div>
                <div class="form-group">
                    <label class="control-label">Password</label>
                    <input type="text" placeholder="请输入用户名" required="" ng-model="use.password" class="form-control">
                </div>
                <div class="clearfix">
                    <label>
                        <input type="checkbox" value="" name="account_remember" />
                        <span class="fa fa-check"></span>
                        记住账号
                    </label>
                </div>
                <button type="submit" class="btn btn-primary btn-block" ng-click="loginBtn()">Login</button>
            </form>
        </div>
<script>
    //账号admin 密码admin
    var app = angular.module('login', ['ui.router','ngCookies']);
    app.controller('loginadmin', function($scope,$state,$log,$cookieStore) {
        $scope.use ={};
        //------------------------------------------------------------------//
        $("#siteSelect").change(function(){
            $scope.use.region =$(this).val();
        });
        $scope.data =[
            {"region":"选择地区"},
            {"region":"海南"},
            {"region":"青岛"}
        ];
        $scope.loginBtn =function () {
            if($scope.use.name == "admin" && $scope.use.name =="admin"){
                location.href="index.html";
                $cookieStore.put("admin",{admin:$scope.use.name,password:$scope.use.password});
                $.cookie('region', $scope.use.region);
            }else{

            }
        };
    });
</script>
</body>
</html>